package com.xingzuo.library_translation.ui.fragment;

import android.view.View;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemClickListener;
import com.xingzuo.base.app.AppActivityKey;
import com.xingzuo.base.ui.mvp.base.adapter.BaseAdapter;
import com.xingzuo.base.ui.mvp.base.refresh.BaseRecyclerRefreshFragment;
import com.xingzuo.library_translation.R;
import com.xingzuo.library_translation.adapter.TranslationAdapter;
import com.xingzuo.library_translation.contract.TranslationContract;
import com.xingzuo.library_translation.presenter.TranslationPresenter;

import java.util.ArrayList;

public class TranslationListFrgament extends BaseRecyclerRefreshFragment<TranslationContract.View, TranslationPresenter>implements TranslationContract.View {

    @Override
    public BaseAdapter createRecyclerAdapter() {
        return new TranslationAdapter(R.layout.item_translation_list,new ArrayList<>());
    }

    @Override
    public TranslationPresenter getPresenter() {
        return new TranslationPresenter();
    }

    @Override
    public void initView() {
        getRefreshLayout().autoRefresh();
    }

    @Override
    public void initLinsenterner() {
        getRecyclerAdapter().setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
                startIntent(AppActivityKey.COMMENTSACTIVITY);
            }
        });
    }

    @Override
    public void getData() {

    }
}